Skip to content

chore(alerts): Remove triggered_incidents from AlertRuleTrigger#115449

Merged
ceorourke merged 1 commit into
masterfrom
ceorourke/rm-triggered_incidents_alertruletrigger
May 12, 2026
Merged

chore(alerts): Remove triggered_incidents from AlertRuleTrigger#115449
ceorourke merged 1 commit into
masterfrom
ceorourke/rm-triggered_incidents_alertruletrigger

Conversation

@ceorourke
Copy link
Copy Markdown
Member

Prepare to remove IncidentTrigger by removing the triggered_incidents column from AlertRuleTrigger.

@ceorourke ceorourke requested review from a team as code owners May 12, 2026 22:34
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label May 12, 2026
]

operations = [
SafeRemoveField(
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I've never removed a m2m field before - I got a couple errors trying to either first set it to be nullable (which makes sense) or adding a db_constraint=False - lmk if there is something else I need to do here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the many-to-many is managed via a through table that has FKs to this table I think this is all you need to do. Probably for completeness you need to do the final deletion migration too, but I think it will be a no-op

@github-actions
Copy link
Copy Markdown
Contributor

This PR has a migration; here is the generated SQL for src/sentry/migrations/1090_rm_triggered_incidents_alertruletrigger.py

for 1090_rm_triggered_incidents_alertruletrigger in sentry

--
-- Moved alertruletrigger.triggered_incidents field to pending deletion state
--
-- (no-op)

]

operations = [
SafeRemoveField(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the many-to-many is managed via a through table that has FKs to this table I think this is all you need to do. Probably for completeness you need to do the final deletion migration too, but I think it will be a no-op

@ceorourke ceorourke merged commit 8bb2202 into master May 12, 2026
86 checks passed
@ceorourke ceorourke deleted the ceorourke/rm-triggered_incidents_alertruletrigger branch May 12, 2026 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants